/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./src/format.js":
/*!***********************!*\
  !*** ./src/format.js ***!
  \***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"safeMobile\": () => (/* binding */ safeMobile),\n/* harmony export */   \"safeIdCard\": () => (/* binding */ safeIdCard),\n/* harmony export */   \"date\": () => (/* binding */ date)\n/* harmony export */ });\nfunction safeMobile(val) {\r\n  if (!val) return val\r\n\r\n  if (typeof(val) !== 'string') {\r\n    val = String(val)\r\n  }\r\n\r\n  if (val.length !== 11) return val\r\n\r\n  return `${val.substr(0, 3)}****${val.substr(7)}`\r\n}\r\n\r\nfunction safeIdCard(val) {\r\n  if (!val) return val\r\n\r\n  if (typeof(val) !== 'string') {\r\n    val = String(val)\r\n  }\r\n\r\n  if (val.length !== 15 && val.length !== 18) return val\r\n\r\n  if (val.length === 15) {\r\n    return `${val.substr(0, 3)}********${val.substr(11)}`\r\n  } else {\r\n    return `${val.substr(0, 3)}***********${val.substr(14)}`\r\n  }\r\n}\r\n\r\n/**\r\n * format date\r\n * @param {*} timestamp \r\n * @param {*} format yyyy-mm-dd hh:mm:ss\r\n */\r\nfunction date(timestamp, format='yyyy-mm-dd hh:mm') {\r\n  let temp = ''\r\n  const date = new Date(timestamp)\r\n  if (format.indexOf('yyyy') > -1) {\r\n    temp += date.getFullYear()\r\n  }\r\n  if (format.indexOf('-mm') > -1) {\r\n    temp += !!temp ? '-' : ''\r\n    temp += makeUp10(date.getMonth() + 1)\r\n  }\r\n  if (format.indexOf('dd') > -1) {\r\n    temp += !!temp ? '-' : ''\r\n    temp += makeUp10(date.getDate())\r\n  }\r\n  if (format.indexOf('hh') > -1) {\r\n    temp += !!temp ? ' ' : ''\r\n    temp += makeUp10(date.getHours())\r\n  }\r\n  if (format.indexOf(':mm') > -1) {\r\n    temp += !!temp ? ':' : ''\r\n    temp += makeUp10(date.getMinutes())\r\n  }\r\n  if (format.indexOf('ss') > -1) {\r\n    temp += !!temp ? ':' : ''\r\n    temp += makeUp10(date.getSeconds())\r\n  }\r\n  return temp\r\n}\r\n\r\nfunction makeUp10(val) {\r\n  return val < 10 ? `0${val}` : val\r\n}\n\n//# sourceURL=webpack://js-guava/./src/format.js?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = {};
/******/ 	__webpack_modules__["./src/format.js"](0, __webpack_exports__, __webpack_require__);
/******/ 	var __webpack_export_target__ = exports;
/******/ 	for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
/******/ 	if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
/******/ 	
/******/ })()
;